import request from '@/utils/request'

export function add(data) {
  return request({
    url: 'api/hospital',
    method: 'post',
    data
  })
}

export function del(ids) {
  return request({
    url: 'api/hospital/',
    method: 'delete',
    data: ids
  })
}

export function edit(data) {
  return request({
    url: 'api/hospital',
    method: 'put',
    data
  })
}

export function getNameAndId() {
  return request({
    url: 'api/hospital/getNameAndId',
    method: 'get'
  })
}

// export function changeState(data) {
//   return request({
//     url: '/api/hospital/changeState/${id}/${state}',
//     method: 'post'
//   })
// }

export function getHospitalByName(data) {
  return request({
    url: 'api/hospital/getByName?name=' + data,
    method: 'get'
  })
}

export function getByName(data) {
  return request({
    url: 'api/pharmaceuticalCompany/getByName?name=' + data,
    method: 'get'
  })
}

export function uploadImages(data) {
  return request({
    url: 'api/hospital/upload',
    method: 'post',
    data
  })
}

export default {add, edit, del, getNameAndId, getHospitalByName}
